export const ROOM_STATUS = {
  UN_READY: 0, //"等待用户准备",
  READY: 1, //"所有用户已准备"
  GAMEING: 2, //"游戏中"
  COM_SCORES: 3, //"游戏尾期，统计分数与结果"
  SHOW_SCORES: 4, //"游戏尾期，显示结果"
};
export const ROOM_STATUS_STR = {
  [ROOM_STATUS.UN_READY]: "等待用户准备",
  [ROOM_STATUS.READY]: "所有用户已准备",
  [ROOM_STATUS.GAMEING]: "游戏中",
  [ROOM_STATUS.COM_SCORES]: "游戏尾期，统计分数与结果",
  [ROOM_STATUS.SHOW_SCORES]: "游戏尾期，显示结果",
};
export function roomStatusToString(status) {
  return ROOM_STATUS_STR[status]
};
export const PLAYER_STATUS = {
  FREE: 0, // "空闲",
  UN_READY: 1, // "未准备",
  READY: 2, // "已准备",
  WAIT_ACTION: 3, // "等待动作",
  CAN_ACTION: 4, // "可动作"
  BEFORE_SUBMIT: 5, // "正在摆牌"
  AFTER_SUBMIT: 6, // "等待其它玩家提交摆牌结果"

  IN_QUEUE: 10, // "匹配队列中",
  BEFORE_QUEUE_TO_ROOM: 11, // "等待确认匹配",
  AFTER__QUEUE_TO_ROOM: 12, // "确认匹配，等待其它玩家确认",
};
export const PLAYER_STATUS_STR = {
  [PLAYER_STATUS.FREE]: "空闲",
  [PLAYER_STATUS.UN_READY]: "未准备",
  [PLAYER_STATUS.READY]: "已准备",
  [PLAYER_STATUS.WAIT_ACTION]: "等待动作",
  [PLAYER_STATUS.CAN_ACTION]: "可动作",
  [PLAYER_STATUS.BEFORE_SUBMIT]: "正在摆牌",
  [PLAYER_STATUS.AFTER_SUBMIT]: "等待其它玩家提交摆牌结果",
  [PLAYER_STATUS.IN_QUEUE]: "匹配队列中",
  [PLAYER_STATUS.BEFORE_QUEUE_TO_ROOM]: "等待确认匹配",
  [PLAYER_STATUS.AFTER__QUEUE_TO_ROOM]: "确认匹配，等待其它玩家确认",
};
export function playerStatusToString(status) {
  return PLAYER_STATUS_STR[status]
}

export const SCORE_TYPE = new Map();
[
  ["straight_flush", 10], //同花顺
  ["four", 9], //铁支
  ["full_house", 8], //葫芦
  ["flush", 7], //同花
  ["straight", 6], //顺子
  ["three", 5], //三条
  ["two_pair", 4], //两对
  ["two", 3], //对子
  ["any", 2], //散牌

  ["three_straight", 21], // 三顺子
  ["three_flush", 22], // 三同花
  ["six_pair", 23], // 六对半
  ["all_small", 24], // 全小
  ["all_big", 25], // 全大
  ["one_long", 26], // 一条龙
  ["king_long", 27], // 至尊青龙
].forEach(([type, handle_weight]) => {
  SCORE_TYPE.set(handle_weight, type)
});
